<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
								xmlns:ui="http://java.sun.com/jsf/facelets"
								xmlns:h="http://java.sun.com/jsf/html"
								xmlns:f="http://java.sun.com/jsf/core"
								xmlns:a4j="http://richfaces.org/a4j"
								xmlns:rich="http://richfaces.org/rich"
								template="layout/template.xhtml">

	<ui:define name="body">
		STUDIES

		Found: <h:outputText value="#{studyBeanModel.rowCount}"/> Studies

		<h:form>
			<rich:datascroller for="studies" maxPages="5"/>
                <rich:spacer height="30" />
			<rich:dataTable
					id="studies"
					onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
					onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
					cellpadding="0" cellspacing="0"
					width="700" border="0"
					rows="20"
					var="studyBean"
					value="#{studyBeanModel}" >

				<f:facet name="header">
					<rich:columnGroup>

						<rich:column>
							<h:outputText value="Investigation"/>
						</rich:column>

						<rich:column>
							<h:outputText value="Acc"/>
						</rich:column>

						<rich:column>
							<h:outputText value="Title"/>
						</rich:column>

						<rich:column>
							<h:outputText value="Design"/>
						</rich:column>

						<!--<rich:column>-->
							<!--<h:outputText value="Sample number"/>-->
						<!--</rich:column>-->
						<rich:column>
							<h:outputText value="Assays"/>
						</rich:column>

					</rich:columnGroup>
				</f:facet>

				<rich:column>
					<rich:subTable
							value="#{studyBean.study.investigations}" var="investigation">
						<rich:column>
							<h:outputText value="#{investigation.title}"/>
						</rich:column>
					</rich:subTable>

				</rich:column>

				<rich:column>
					<!--<h:outputLink value="study.seam">-->
					<!--<f:param name="studyId" value="#{studyBean.study.id}"/>-->
					<!--</h:outputLink>-->
					<a4j:commandLink value="#{studyBean.study.acc}" action="/study.xhtml">
						<a4j:actionparam name="studyId" value="#{studyBean.study.id}"/>
					</a4j:commandLink>

				</rich:column>
				<rich:column>
					<h:outputText value="#{studyBean.study.title}"/>
				</rich:column>
				<rich:column>
					<!--<h:outputText value="#{study.assays.size}"/>-->
					<!--<h:outputText value="#{study.design}!=null ?  #{study.design.name}: 'no design'}"/>-->
					<h:outputText value="#{studyBean.study.design.value}"/>

				</rich:column>

				<!--<rich:column>-->
					<!--<h:outputText value="#{studyBean.sourceMaterials.size}"/>-->
				<!--</rich:column>-->

				<rich:column>
					<rich:subTable
							value="#{studyBean.assayTypes}" var="assayType">
						<rich:column>
							<h:outputText value="#{assayType.name}"/> =
							<h:outputText value="#{studyBean.getAssaysByType(assayType).size}"/>

						</rich:column>
					</rich:subTable>

				</rich:column>

			</rich:dataTable>

		</h:form>
	</ui:define>

</ui:composition>
